package org.jivesoftware.smackx.pubsub;

import java.util.Collections;
import java.util.Date;
import java.util.List;

public class ItemPublishEvent<T extends Item> extends SubscriptionEvent
{
  private List<T> items;
  private Date originalDate;

  public ItemPublishEvent(String paramString, List<T> paramList)
  {
    super(paramString);
    this.items = paramList;
  }

  public ItemPublishEvent(String paramString, List<T> paramList, List<String> paramList1)
  {
    super(paramString, paramList1);
    this.items = paramList;
  }

  public ItemPublishEvent(String paramString, List<T> paramList, List<String> paramList1, Date paramDate)
  {
    super(paramString, paramList1);
    this.items = paramList;
    if (paramDate != null)
      this.originalDate = paramDate;
  }

  public List<T> getItems()
  {
    return Collections.unmodifiableList(this.items);
  }

  public Date getPublishedDate()
  {
    return this.originalDate;
  }

  public boolean isDelayed()
  {
    int i;
    if (this.originalDate != null)
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  public String toString()
  {
    String str;
    StringBuilder localStringBuilder = new StringBuilder(String.valueOf(getClass().getName())).append("  [subscriptions: ").append(getSubscriptions()).append("], [Delayed: ");
    if (isDelayed())
      str = this.originalDate.toString();
    while (true)
    {
      return str + ']';
      str = "false";
    }
  }
}